﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Deadline.cs" company="HelloWorld">
//   BY黄媛媛
// </copyright>
// <summary>
//   Defines the Deadline type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace WindowsFormsApp2.Model
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics.CodeAnalysis;

    /// <summary>
    /// The deadline.
    /// </summary>
    internal class Deadline
    {
        /// <summary>
        /// The deadlines.
        /// </summary>
        [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "Reviewed. Suppression is OK here.")]
        public static List<Deadline> Deadlines = new List<Deadline>();

        /// <summary>
        /// The deadline number.
        /// </summary>
        private static int ddlNum; // 用于生成ddlID

        /// <summary>
        /// Initializes a new instance of the <see cref="Deadline"/> class.
        /// </summary>
        /// <param name="id">
        /// The id.
        /// </param>
        /// <param name="courseId">
        /// The course id.
        /// </param>
        /// <param name="task">
        /// The task.
        /// </param>
        /// <param name="dateTime">
        /// The date time.
        /// </param>
        public Deadline(int id, long courseId, string task, DateTime dateTime)
        {
            this.DDLId = id;
            this.CourseId = courseId;
            this.Task = task;
            this.DeadlineDate = dateTime;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Deadline"/> class.
        /// </summary>
        /// <param name="courseId">
        /// The course id.
        /// </param>
        /// <param name="task">
        /// The task.
        /// </param>
        /// <param name="dateTime">
        /// The date time.
        /// </param>
        public Deadline(long courseId, string task, DateTime dateTime)
        {
            this.DDLId = ddlNum;
            ddlNum++;
            this.CourseId = courseId;
            this.Task = task;
            this.DeadlineDate = dateTime;
        }

        /// <summary>
        /// Gets or sets the deadline id.
        /// </summary>
        public int DDLId { get; set; }

        /// <summary>
        /// Gets or sets the course id.
        /// </summary>
        public long CourseId { get; set; }

        /// <summary>
        /// Gets or sets the task.
        /// </summary>
        public string Task { get; set; }

        /// <summary>
        /// Gets or sets the deadline date.
        /// </summary>
        public DateTime DeadlineDate { get; set; }
    }
}
